﻿<%@ Page Language="C#" %>
<%@ Import Namespace="YuuzleComic.DBUtility" %>
<%@ Import Namespace="YuuzleComic.Config" %>
<%@ Import Namespace="YuuzleComic.Common" %>
<%@ Import Namespace="YuuzleComic.BLL" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html>

<script runat="server">
    
    string[] hotIdArr = new string[] { "4681", "7382", "7620", "7634", "7675", "8017", "7916", "7894", "8004" };
    string hotYdmIds = "3807,3750,3808,3751,6059";
    string top_nav = Input.ReadTextFile("/admin/temp/common/top-nav.html");
    string top_main = Input.ReadTextFile("/admin/temp/common/top-main.html");
    string foot = Input.ReadTextFile("/admin/temp/common/foot.html");
    DataSet ds;
    string hotComic = "热门漫画：";
    string description = "";
    ad adbll = new ad();
</script>
    <%
        ds = DbHelperSQL.Query("SELECT top(11) a.id,a.mhmc,c.zjmc FROM comics a join (select cid,MAX(ordernum) ordernum from zj group by cid) b on a.id=b.cid join zj c on c.ordernum=b.ordernum where a.id in (" + string.Join(",", hotIdArr) + ") order by a.hits desc");
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            DataRow dr = ds.Tables[0].Rows[i];
            string cname = Input.FliterEnglish(dr["mhmc"].ToString());
            if (i == 0)
            {
                description = cname + Input.GetNumberInt(dr["zjmc"].ToString());
                hotComic += "<a href=\"/comic/" + dr["id"] + "/\" target=\"_blank\" title=\"" + dr["mhmc"] + "\"><strong>" + cname + "</strong></a> ";
            }
            else
            {
                hotComic += "<a href=\"/comic/" + dr["id"] + "/\" target=\"_blank\" title=\"" + dr["mhmc"] + "\">" + cname + "</a> ";
            }
        }
         %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>火影忍者NARUTO 高清漫画 在线漫画网 <%=verConfig.siteName%></title>
    <meta name="Keywords" content="漫画、在线漫画、火影忍者漫画、美型妖精大混战漫画、暗夜协奏曲漫画、三眼哮天录、斗罗大陆漫画、斗破苍穹漫画、暴走邻家漫画" />
    <meta name="Description" content="<%=description %>已火速更新，<%=verConfig.siteName%>在线漫画网始终努力为漫画迷提供及时的漫画更新、高清晰的漫画资源和优质的观看体验。在线漫画,美型妖精大混战,火影忍者,暴走邻家,三眼哮天录,斗罗大陆,斗破苍穹,偷星九月天,暗夜协奏曲,漫画在线看" />
    <link href="/css/main.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="/Scripts/Common.js"></script>
    <style type="text/css">
        .tabList li{width:184px;}
        .tabList li.end{width:184px;}
    </style>
</head>
<body>
    <%= Input.replaceTag(top_nav) %>
    <%= Input.replaceTag(top_main).Replace( "<script type=\"text/javascript\">hotComic();</script>",hotComic) %>
	<div class="blank4">
	</div>
	<div style="width:978px;margin:0 auto; border:1px solid #999;text-align:center;height:90px">
        <%= adbll.GetModelByCache(1).adcontent %>
	</div>
	<div class="blank4">
	</div>
    <div class="main">
        <div class="main_left_out">
            <div class="left_top">
                <div class="tabList" id="tabList">
                    <ul>
                        <li class="on" onmouseover="changeTab(4,0)"><strong>热门连载漫画</strong> </li>
                        <li onmouseover="changeTab(4,1)"><strong>经典完结漫画</strong></li>
                        <li onmouseover="changeTab(4,2)"><strong>最新上架漫画</strong> </li>
                        <li class="end" onmouseover="changeTab(4,3)"><strong id="hk">最新推荐漫画<em></em></strong></li></ul>
                </div>
                <div class="blank8">
                </div>
                <div class="comicList" id="comicList">
                    <ul style="display: block;">
                        <%       
                            ds = DbHelperSQL.Query("select top(10) a.id,a.mhmc,a.mhfm,c.id zjid,c.zjmc from comics a join (select cid,MAX(ordernum) ordernum from zj group by cid) b on a.id=b.cid join zj c on c.ordernum=b.ordernum where a.zt=0 order by a.hits desc");
foreach (DataRow dr in ds.Tables[0].Rows)
{
%>
                        <li><a href="/comic/<%=dr["id"]%>" target="_blank" title="<%=dr["mhmc"]%>">
                            <img src="/cpic/<%=dr["mhfm"]%>" alt="<%=dr["mhmc"]%>" /></a><a href="/comic/<%=dr["ID"]%>" target="_blank"
                                title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a>[<a href="/comic/<%=dr["ID"]%>/<%=dr["zjid"]%>.html"
                                    target="_blank" title="<%=dr["zjmc"]%>" class="red"><%=dr["zjmc"]%></a>]</li>
                        <%		 
}
                        %></ul>
                    <ul>
                        <%       
                            ds = DbHelperSQL.Query("select top(10) a.id,a.mhmc,a.mhfm,a.zt,c.id zjid,c.zjmc from comics a join (select cid,MAX(ordernum) ordernum from zj group by cid) b on a.id=b.cid join zj c on c.ordernum=b.ordernum where a.zt=1 order by a.hits desc");
foreach (DataRow dr in ds.Tables[0].Rows)
{
                        %><li><a href="/comic/<%=dr["id"]%>" target="_blank" title="<%=dr["mhmc"]%>">
                            <img src="/cpic/<%=dr["mhfm"]%>" alt="<%=dr["mhmc"]%>" /></a> <a href="/comic/<%=dr["id"]%>" target="_blank"
                                title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a>[<a href="/comic/<%=dr["id"]%>/<%=dr["zjid"]%>.html" target="_blank" title="<%=dr["zjmc"]%>"
                                    <%if(Convert.ToBoolean(dr["zt"])){%>class="green">完结<%}else{%>class="red"><%=dr["zjmc"]%><%}%></a>]</li><%
}
                                    %>
                    </ul>
                    <ul>
                        <%       
                            ds = DbHelperSQL.Query("select top(10) a.id,a.mhmc,a.mhfm,a.zt,c.id zjid,c.zjmc from comics a join (select cid,MAX(ordernum) ordernum from zj group by cid) b on a.id=b.cid join zj c on c.ordernum=b.ordernum order by a.id desc");
foreach (DataRow dr in ds.Tables[0].Rows)
{
                        %>
                        <li><a href="/comic/<%=dr["id"]%>" target="_blank" title="<%=dr["mhmc"]%>">
                            <img src="/cpic/<%=dr["mhfm"]%>" alt="<%=dr["mhmc"]%>" /></a><a href="/comic/<%=dr["id"]%>" target="_blank"
                                title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a>[<a href="/comic/<%=dr["id"]%>/<%=dr["zjid"]%>.html"
                                    target="_blank" title="<%=dr["zjmc"]%>" <%if(Convert.ToBoolean(dr["zt"])){%>class="green">完结<%}else{%>class="red"><%=dr["zjmc"]%><%}%></a>]</li>
                        <%
}
                        %>
                    </ul>
                    <ul>
                        <%       
                            ds = DbHelperSQL.Query("select top(10) a.id,a.mhmc,a.mhfm,a.zt,c.id zjid,c.zjmc from comics a join (select cid,MAX(ordernum) ordernum from zj group by cid) b on a.id=b.cid join zj c on c.ordernum=b.ordernum where a.tj=1 order by a.id desc");
foreach (DataRow dr in ds.Tables[0].Rows)
{       
                        %>
                        <li><a href="/comic/<%=dr["id"]%>" target="_blank" title="<%=dr["mhmc"]%>">
                            <img src="/cpic/<%=dr["mhfm"]%>" alt="<%=dr["mhmc"]%>"/></a><a href="/comic/<%=dr["id"]%>" target="_blank"
                                title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a>[<a href="/comic/<%=dr["id"]%>/<%=dr["zjid"]%>.html"
                                    target="_blank" title="<%=dr["zjmc"]%>" <%if(Convert.ToBoolean(dr["zt"])){%>class="green">完结<%}else{%>class="red"><%=dr["zjmc"]%><%}%></a>]</li>
                        <%
}
                        %>
                    </ul>
                </div>
            </div>
            <div class="blank4">
            </div>
            <div style="width: 744px;border:1px solid #999;text-align:center;height:90px">
				<%= adbll.GetModelByCache(2).adcontent %>
            </div>
            <div class="blank4">
	        </div>
            <div class="main_left">
                <div style="width: 98%; text-align: left;">
                    <div class="outer">
                        <h2 class="main_bar">
                            <strong>漫画点击总排行</strong></h2>
                        <div style="padding: 3px;">
                            <div class="topHits">
                                <ul>
                                    <%     
ds = DbHelperSQL.Query("select top(23) id,mhmc,mhfm from comics order by hits desc");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{ 
    DataRow dr = ds.Tables[0].Rows[i];
 %>
                                    <li><span class="t<%=i+1%>">
                                        <%=i+1%>.</span><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a></li>
                                    <%
}
                                    %>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="blank4">
                    </div>
                    <div class="outer">
                        <div class="main_bar">
                            <strong>漫画点击月排行</strong></div>
                        <div style="padding: 3px;">
                            <div class="topHits">
                                <ul>
                                    <%       
ds = DbHelperSQL.Query("select top(23) id,mhmc,mhfm from comics order by hits_m desc");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{ 
    DataRow dr = ds.Tables[0].Rows[i];
     %>
                                    <li><span class="t<%=i+1%>">
                                        <%=i+1%>.</span><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a></li>
                                    <%
    }
                                        %>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="blank4">
                    </div>
                    <div class="outer">
                        <div class="main_bar">
                            <strong>漫画点击周排行</strong></div>
                        <div style="padding: 3px;">
                            <div class="topHits" style="padding-bottom: 15px;">
                                <ul>
                                    <%       
ds = DbHelperSQL.Query("select top(23) id,mhmc,mhfm from comics order by hits_w desc");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{ 
    DataRow dr = ds.Tables[0].Rows[i];
     %>
                                    <li><span class="t<%=i+1%>">
                                        <%=i+1%>.</span><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a></li><%
                                                                                                                                                        }
                                        %>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="main_center">
                <div class="outer">
                    <div class="chr_bar">
                        <strong>热门漫画更新</strong></div>
                    <div class="hotChapter">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%    
                                foreach (string id in hotIdArr)
                                {
                                    ds = DbHelperSQL.Query("select top(5) a.id,a.mhmc,a.mhfm,b.id zjid,b.zjmc from comics a join zj b on a.id=b.cid where a.id=" + id + " order by b.ordernum desc");
                                    if (ds.Tables[0].Rows.Count > 0)
                                    {
                                    %>
                                    <li><strong><a href="/comic/<%=ds.Tables[0].Rows[0]["id"] %>/" target="_blank"><%= Input.FliterEnglish(ds.Tables[0].Rows[0]["mhmc"].ToString()) %>漫画</a></strong>
                                        <%
                                    foreach (DataRow dr in ds.Tables[0].Rows)
                                    {
                                        string zjmc = Input.FliterEnglish(dr["mhmc"].ToString()) + Input.GetNumberInt(dr["zjmc"].ToString());
                                        %>
                                            <a href="/comic/<%=dr["id"] %>/<%= dr["zjid"] %>.html" target="_blank" title="<%= zjmc %>"><%= zjmc %></a>
                                        <%
                                    }
                                       %>
                                        </li>
                                        <%  
                                    }  
                                } %>
                        </ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#A">更多</a></span><strong>字母 A - D</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%    
    foreach (string zm in new string[]{"A","B","C","D"})
	{
		 ds = DbHelperSQL.Query("select top(10) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
        foreach (DataRow dr in ds.Tables[0].Rows)
	    { %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
	    }
	}
                            %>
                        </ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#E">更多</a></span><strong>字母 E - H</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%     
    foreach (string zm in new string[]{"E","F","G","H"})
	{
		 ds = DbHelperSQL.Query("select top(10) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
        foreach (DataRow dr in ds.Tables[0].Rows)
	    {
 %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }
                            }
                            %>
                        </ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#I">更多</a></span><strong>字母 I - L</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%   
    foreach (string zm in new string[]{"I","J","K","L"})
	{
		 ds = DbHelperSQL.Query("select top(10) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
        foreach (DataRow dr in ds.Tables[0].Rows)
	    {
%>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }
                            }
                            %>
                        </ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#M">更多</a></span><strong>字母 M - P</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <% 
foreach (string zm in new string[]{"M","N","O","P"})
{
		ds = DbHelperSQL.Query("select top(10) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{     
 %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }}
                            %>
                        </ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#Q">更多</a></span><strong>字母 Q - V</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%  
foreach (string zm in new string[]{"Q","R","S","T"})
{
		ds = DbHelperSQL.Query("select top(10) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{         
 %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }}
foreach (string zm in new string[]{"U","V"})
{
		ds = DbHelperSQL.Query("select top(5) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{     
 %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }}
                            %>
                        </ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#W">更多</a></span><strong>字母 W - Z</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%   
 foreach (string zm in new string[]{"W","X","Y","Z"})
{
		ds = DbHelperSQL.Query("select top(10) id,mhmc,mhfm from comics where zm ='"+zm+"' order by hits desc");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{     
 %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }}
                            %></ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <div class="chr_bar">
                        <span><a href="/list/all.html#0-9">更多</a></span><strong>字母 0 - 9</strong></div>
                    <div class="chrComicList">
                        <div class="blank4">
                        </div>
                        <ul>
                            <%       
 
		ds = DbHelperSQL.Query("select top(40) id,mhmc,mhfm from comics where zm in ('0','1','2','3','4','5','6','7','8','9','0-9') order by hits desc");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{     
 %>
                            <li><a href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>">
                                <%=dr["mhmc"]%></a></li>
                            <%
                            }
                            %></ul>
                        <div class="blank4">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="main_right">
            <div style="width: 98%; float: right;">
                <div class="outer">
                    <h2 class="main_bar">
                        新闻公告 - 敬请留意</h2>
                    <div class="Advices">
                        <ul>
                            <%       
		ds = DbHelperSQL.Query("select top(6) * from news order by id desc");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{  
 %><li><a href="<%=dr["newinfo"]%>" target="_blank" title="<%=dr["newtitle"]%>">
    <%=dr["newtitle"].ToString()%></a></li><%
                                                                  }
    %></ul>
                        <div class="blank2">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <h2 class="bar">
                        <strong>动漫最新更新</strong></h2>
                    <div class="Advices">
                        <ul>
                            <%       
    ds = DbHelperSQL.Query("SELECT m_id ,m_name ,m_note,m_addtime FROM ydm88.dbo.m_data where m_id in (" + hotYdmIds + ")");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{  
 %><li><a href="http://www.ydm88.com/dmview/<%=dr["m_id"]%>.html" target="_blank" title="<%=dr["m_name"]%>">
    <%=dr["m_name"].ToString() + dr["m_note"].ToString().Substring(1)%> <%=Convert.ToDateTime(dr["m_addtime"]).ToString("M月d日") %>更新</a></li><%
    }
    %></ul>
                        <div class="blank2">
                        </div>
                    </div>
                </div>
                <div class="blank4">
                </div>
                <div class="outer">
                    <h2 class="bar">
                        <span><a href="/list/update.html" class="red">&gt;&gt;更多</a> </span>
                        <strong>漫画最新更新</strong></h2>
                    <div class="newUpdate" style="padding-bottom: 20px;">
                        <ul>
                            <%       
                                ds = DbHelperSQL.Query("select top(68) a.id,a.mhmc,a.mhfm,a.zt,c.id zjid,c.zjmc,c.time,DateDiff(day,time,getdate()) oday from comics a join (select cid,MAX(id) id from zj group by cid) b on a.id=b.cid join zj c on b.id=c.id order by c.id desc");
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
	                            {  
                                    DataRow dr = ds.Tables[0].Rows[i];
%>
                            <li class="t<%=i+1%>"><span <%=Convert.ToInt32(dr["oday"]) <= 2 ? "class=red" : ""%>>
                                <%=Convert.ToDateTime(dr["time"]).ToShortDateString()%></span><a
                                    href="/comic/<%=dr["id"]%>/" target="_blank" title="<%=dr["mhmc"]%>"><%=dr["mhmc"]%></a><em>[<a href="/comic/<%=dr["id"]%>/<%=dr["zjid"]%>.html" target="_blank" class="<%=Convert.ToBoolean(dr["zt"])?"green":"red"%>" title="<%=dr["zjmc"]%>"><%=Convert.ToBoolean(dr["zt"])?"完结":dr["zjmc"]%></a>]</em></li><%
                                                                                                                                                                                                                                                                                                              }
                                %>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="blank4">
    </div>
    <div class="main">
        <div class="outer">
            <h2 class="main_bar">
                <span style="float: right; font-size: 12px; font-weight: normal; color: #FF0000;">诚征链接,流量合作(QQ:<%=verConfig.QQ_z%>)</span>友情链接</h2>
            <div class="flinks">
                <div class="blank4">
                </div>
                <ul>
                    <%  
    ds = DbHelperSQL.Query("SELECT top(50) * FROM link order by id");
    foreach (DataRow dr in ds.Tables[0].Rows)
	{       
 %><li><a href="<%=dr["siteurl"]%>" target="_blank" title="<%=string.IsNullOrEmpty(dr["siteinfo"].ToString().Trim()) ? "" : dr["siteinfo"].ToString().Trim()%>">
    <%=Input.GetSubString(dr["sitename"].ToString(),13,"")%></a></li><%
                                                                  }
    %>
                </ul>
                <div class="blank4">
                </div>
            </div>
        </div>
    </div>
    <div class="blank4">
    </div>
    <div style="text-align:center; line-height:1.8em;">
        漫画导读：<% 
            ds = DbHelperSQL.Query("select top(10) id,mhmc from comics where id in (" + Input.ReadTextFile("~/nors.txt") + ") order by newid()");
           foreach (DataRow dr in ds.Tables[0].Rows)
           {
               %>
            <a href="/comic/<%= dr["id"] %>/" title="<%=dr["mhmc"] %>"><%=dr["mhmc"] %></a> 
        <%
           }
            %>
        </div>
    <%= Input.replaceTag(foot) %>
</body>
</html>
